package com.by.core.controller;



import com.by.core.bean.ResultBean;

import java.util.List;

public  class BaseController {

    public static ResultBean success(String msg){
        return handler(ApiCode.SUCCESS,msg,null);
    }


    public static ResultBean success(String msg, Object data){
        return handler(ApiCode.SUCCESS,msg,data);
    }

    public static ResultBean fail(String msg){
        return handler(ApiCode.FAIL,msg,null);
    }

    public static ResultBean fail(String msg, Object data){
        return handler(ApiCode.FAIL,msg,data);
    }

    static ResultBean handler(int code,String msg,Object data){
        return new ResultBean(code,msg,data);
    }
}
